﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.RoleCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;
using System.Data;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.RoleHandler
{
    public class RoleDeleteCommandHandlers : IRequestHandler<RoleDeleteCommand, int>
    {
        IRoleService rSer;

        public RoleDeleteCommandHandlers(IRoleService rSer)
        {
            this.rSer = rSer;
        }
        public async Task<int> Handle(RoleDeleteCommand request, CancellationToken cancellationToken)
        {
            return await  rSer.DeleteRole(request .Rid);
        }
    }
}
